home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Shareware Grab Bag
/
Shareware Grab Bag.iso
/
050
/
madtrb34.arc
/
ACTSK.PAS
next >
Wrap
Pascal/Delphi Source File
|
1986-04-25
|
1KB
|
47 lines
Program ActivateSidekick;
Function Sidekick: Boolean;
Const
SKactOffset = $012D;
SKverOffset = $012A;
Type
RegPack = Record
AX,BX,CX,DX,BP,SI,DI,DS,ES,Flags: Integer;
end;
Address = record
Offset : Integer;
Segment: Integer;
end;
SKstr = array[1..2] of Char;
SKstrPtr = ^SKstr;
Var
SKbios08Trap: Address absolute $0000:$0020 { Sidekick timer tick trap };
SKbios25Trap: Address absolute $0000:$0094 { Sidekick DOS int 25 trap };
SKfound : Boolean;
SKstrCheck : SKstrPtr;
R : RegPack;
Begin
With SKbios25Trap do SKstrCheck:=Ptr(Segment, Offset-2);
SKfound:=(SKstrCheck^ = 'SK');
If Not SKFound Then Begin
With SKbios08Trap do SKstrCheck:=Ptr(Segment, Offset-4);
SKfound:=(SKstrCheck^ = 'SK');
End;
{ Sidekick version number must be >= 1.50 }
SKfound:=(SKfound and (Mem[Seg(SKstrCheck^): SKverOffset] >= 1)
and (Mem[Seg(SKstrCheck^): SKverOffset+1] >= 50));
If SKFound Then Begin
Mem[Seg(SKstrCheck^): SKactOffset]:=1; { Set Sidekick activate flag }
Intr($28, R); { Turn control over to Sidekick }
End;
Sidekick:=SKfound;
end { Sidekick };
begin
if not Sidekick then Writeln('Sidekick 1.50 or later not loaded');
end.
Sidekic